home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / thor / fse / asciipic.fse next >
Text File  |  1996-11-10  |  1KB  |  48 lines

  1. /* ASCIIPic.fse by Troels Walsted Hansen
  2. ** $VER: ASCIIPic.fse v1.02 (03.12.94)
  3. **
  4. ** Convert picture to ASCII and include it in the FSE. Uses
  5. ** 'ilbm2ascii' v1.4 by Tobias Ferber.
  6. */
  7.  
  8. defpath = 'work:pictures/'        /* Edit to suit your environment */
  9.  
  10. options results
  11.  
  12. /* needs THOR and FSE functions */
  13.  
  14. if(substr(address(),1,8) ~= "THOR_FSE") then
  15. do
  16.     say "This script should only be started from inside the FSE."
  17.     exit 20
  18. end
  19. else fseport = address()
  20.  
  21. p = ' ' || address() || ' ' || show('P',,)
  22. thorport = pos(' THOR.',p)
  23.  
  24. if thorport > 0 then thorport = word(substr(p,thorport+1),1)
  25. else
  26. do
  27.     say 'No THOR port found!'
  28.     exit 10
  29. end
  30.  
  31. address(thorport)
  32.  
  33. REQUESTFILE TITLE '"Select ILBM to convert and include:"' ID '"'defpath'"' FP PAT '"#?"'
  34. if(rc ~= 0) then exit
  35. else picfile = result
  36.  
  37. lastchar = right(picfile,1)
  38. if(rc~=0|lastchar = "/"|lastchar = ":"|picfile = "") then exit
  39.  
  40. address command "ilbm2ascii "||'"'picfile'"'||" > t:FSEASCIIPicture"
  41.  
  42. address(fseport)
  43. INCLUDEFILE 't:FSEASCIIPicture'
  44.  
  45. address command "delete >nil: t:FSEASCIIPicture"
  46.  
  47. exit
  48.